package com.spring.demo.web;

import com.google.common.collect.Maps;
import freemarker.template.Configuration;
import freemarker.template.Template;
import org.springframework.stereotype.Controller;
import org.springframework.ui.freemarker.FreeMarkerTemplateUtils;

@Controller
public class FreeMarkerConetroller {


    public static void main(String[] args) throws Exception {





      Configuration configuration = new Configuration(Configuration.VERSION_2_3_27);

      configuration.setClassLoaderForTemplateLoading(FreeMarkerConetroller.class.getClassLoader(), "/");

      Template template = configuration.getTemplate("index.ftl");


        String s = FreeMarkerTemplateUtils.processTemplateIntoString(template, Maps.newHashMap());
//<@include_page path="index.jsp"/>
        System.out.println(s);


    }



}
